package com.is.add.util.DimensionUtil;

import com.is.add.model.OrderBase;

/**
 * 订单类型维度
 * Created by liuming on 2016/5/6.
 */
public class OrderTypeDimension implements Dimension<OrderBase>{
    /**
     * 通过基础数据分析出维度对应key值
     *
     * @param baseBean 基础Bean
     * @return 维度key
     */
    @Override
    public String compare(OrderBase baseBean) {
        double paySum=baseBean.getPaySum();
        double subsidySum=baseBean.getSubsidySum();
        if(paySum==0){
            return "FREE-免费";
        }
        else if(paySum>0&&subsidySum>0){
            return "DISCOUNT-优惠";
        }
        else if(paySum>0&&subsidySum==0){
            return "PREFERENTIAL-特惠";
        }
        else{
            return "OTHER-其它";
        }
    }

    @Override
    public String getTitle() {
        return null;
    }
}
